import request from '@/utils/request'
import type { ApiResponse } from './components/ApiResponse'
import type { BannerType, HotType, HomeGoodsType } from './components/homeType'
import type { GoodsType } from './components/goodsType'

// 获取轮播图数据
export const getBannerListApi = (distributionSite: string) => {
  return request.get<ApiResponse<[BannerType]>>('/home/banner', {
    params: {
      distributionSite,
    },
  })
}

// 获取新鲜好物
export const getNewListApi = () => {
  return request.get<ApiResponse<[GoodsType]>>('/home/new')
}

// 获取人气推荐
export const getHotListApi = () => {
  return request.get<ApiResponse<[HotType]>>('/home/hot')
}

export const getGoodsListApi = () => {
  return request.get<ApiResponse<[HomeGoodsType]>>('/home/goods')
}
